package com.lzy.webapi.facade;

import com.github.pagehelper.PageInfo;
import com.lzy.framework.core.datasource.multiple.DataSource;
import com.lzy.framework.core.orm.db.Pager;
import com.lzy.product.apis.OrderProfitServiceApi;
import com.lzy.product.apis.StatisticsServiceApi;
import com.lzy.product.dtos.statistics.DayProfitParamDto;
import com.lzy.product.dtos.statistics.DayProfitVoDto;
import com.lzy.product.dtos.statistics.OrderProfitRecordDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class StatisticsFacade {
    @Autowired
    private StatisticsServiceApi statisticsServiceApi;
    @Autowired
    private OrderProfitServiceApi orderProfitServiceApi;

    @DataSource(name = DataSource.DATASOURCE_PRODUCT)
    public List<DayProfitVoDto> queryDayProfitListNoPage(DayProfitParamDto paramDto){
        List<DayProfitVoDto> list = statisticsServiceApi.queryDayProfitListNoPage(paramDto);
        return list;
    }
    @DataSource(name = DataSource.DATASOURCE_PRODUCT)
    public PageInfo queryRecordList(Pager pager,OrderProfitRecordDto paramDto){
        PageInfo<OrderProfitRecordDto> pageInfo = orderProfitServiceApi.queryRecordList(pager, paramDto);
        return pageInfo;
    }
}
